package edu.biwu.utils;

import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.InputStream;

public class SqlSessionFactoryUtils {
    //把类私有化 不允许外部调用
    private SqlSessionFactoryUtils(){

    }
    public static SqlSessionFactory generateSqlSessionFactory() {
        InputStream is = SqlSessionFactoryUtils.class.getClassLoader().getResourceAsStream("sqlMapConfig.xml");

        return (SqlSessionFactory) new SqlSessionFactoryBuilder().build(is);
    }
}
